
export default class util {
 static isEmpty(val) {
   return (!val);
 }
 static setStorage(name, val, def) {
   let bool = this.isEmpty(val);
   if (bool === true) {
     localStorage.setItem(name, JSON.stringify(def));
   } else {
     localStorage.setItem(name, JSON.stringify(val));
   }
 }
 static getStorage(name, def) {
   if (this.isEmpty(localStorage.getItem(name))) {
     console.log(name, def);
     return def;
   } else {
     return JSON.parse(localStorage.getItem(name));
   }
   // return this.isEmpty(localStorage.getItem(name)) ? def : JSON.parse(localStorage.getItem(name));
}
}
